package com.daniel.cms.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.HashMap;

/**
 * 详细说明
 *
 * @author Daniel
 * @version V1.0
 * @date 2020/5/22 16:01
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResultVO<T> implements Serializable {
	/**
	 * 状态码，比如1000代表响应成功
	 */
	private int code;
	/**
	 * 响应信息，用来说明响应情况
	 */
	private String msg;
	/**
	 * 响应的具体数据
	 */
	private T data;

	public ResultVO(T data) {
		this(ResultEnum.SUCCESS, data);
	}

	public ResultVO(ResultEnum resultCode, T data) {
		this.code = resultCode.getCode();
		this.msg = resultCode.getMsg();
		this.data = data;
	}

}
